<template>
  <div class="app-container">
    <el-form ref="form" :model="form" label-width="150px">
      <el-form-item label="用户名：">
        <el-input v-model="form.userName" disabled />
      </el-form-item>
      <el-form-item label="姓名：">
        <el-input v-model="form.realName" disabled />
      </el-form-item>
      <el-form-item label="用户类型：">
        <el-input v-model="form.roleAlias" disabled />
      </el-form-item>
 
    </el-form>
  </div>
</template>

<script>
import { mapState } from 'vuex'

export default {
  data() {
    return {
      form: {
        // userName: '用户名',
        // relName: '真名',
        // roleAlias: '用户类型'
      }
    }
  },
  computed: {
    ...mapState('user', {
      defaultForm: state => {
        const { userName, userInfo } = state
        const { realName, roleAlias } = userInfo
        return {
          userName,
          realName,
          roleAlias,
        }
      }
    })
  },
  mounted() {
    this.form = {
      ...this.defaultForm
    }
  },

  methods: {
    onSubmit() {
     
    },

  }
}
</script>

<style scoped>
.line {
  text-align: center;
}
</style>
